package com.cyf.util;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 图片工具类
 * Created by hfy on 2017/6/5.
 */
@Component
public class ImageUtil {

    @Autowired
    private BasicProperties basicProperties;

    /**
     * 车场入出场图片转成url
     * @param imageId
     * @return
     */
    public String getCarImgHttpUrl(Integer imageId, Integer parkingId) {
        if (imageId == null) {
            return "";
        }
        String serverAddress = basicProperties.getServerAddress();
        return "http://" + serverAddress + ":8892"  + "/openapi/getImage/" + parkingId + "/" + imageId;
    }
}
